1. Technical Field
The present invention relates to a method and system for data processing or information handling systems in general and, in particular, to a method and system for processing vector data in a computer system. Still more particularly, the present invention relates to a method and system for producing a two-bit code result when performing a single instruction multiple data (SIMD) predicate compare operation in three-dimensional graphic operations.
2. Description of the Prior Art
Applications of modern computer systems are requiring greater speed and data handling capabilities for uses such as multimedia and scientific modeling. For example, multimedia systems generally are designed to perform video and audio data compression, decompression, and high-performance manipulation such as three-dimensional imaging and graphics. Three-dimensional imaging and graphics require massive data manipulation and an extraordinary amount of high-performance arithmetic and vector-matrix operations. One such operation is the classical single-instruction multiple-data (SIMD) predicate comparison operation which involves comparing the contents of two vector registers, element by element, for a specific predicate (e.g. is greater than, is less than or is equal to) in producing three-dimensional graphics. For each element the result of the comparison (true or false) is placed in the respective element of a target vector register. The control flow for this type of operation is typically handled in parallelism by executing the operations on all paths of a branch and saving the results in separate registers. A mask or set of masks is then generated based on the condition of the branch wherein the mask(s) are used to perform an element-by-element select between the possible results. This procedure works well for loop-based data parallelism and is efficiently supported using single-instruction multiple-data (SIMD) predicate comparison operations.
However, there are cases when data-driven control flow in instruction sequencing controlled by the results of operations on data is needed to accommodate the occurrence of special events, where specialized data handling is needed in the presence of these events. These special events could manifest themselves in a single element, across all elements, or in no elements at all in a single-instruction multiple-data (SIMD) predicate comparison operation. Additionally, these special events may severely reduce or even eliminate the use of SIMD parallelism. Therefore, there is a need for a method and system that allows control flow using conditional branching on the special event when all comparisons are false or when all predicate comparison results are true. The subject invention herein solves this problem in a new and unique manner that has not been part of the art previously.